import request from '@/utils/request';

// https://yapi.iqidao.com/project/17/interface/api/2312
// 插入生成文件任务
export async function initFileUploadTask(params?: any) {
  return request('/teach-admin/admin/file/initFileUploadTask', {
    params,
  });
}

// https://yapi.iqidao.com/project/17/interface/api/2317
// 个人生成文件目录列表
export async function listFileUploadTaskForCurrentUser(params?: any) {
  return request('/teach-admin/admin/file/listFileUploadTaskForCurrentUser', {
    params,
  });
}

// https://yapi.iqidao.com/project/17/interface/api/2332
// 取消任务
export async function cancelTaskById(id: number, projectType: string) {
  return request('/teach-admin/admin/file/cancelTaskById', {
    params: {
      taskId: id,
      projectType: projectType,
    },
  });
}

// https://yapi.iqidao.com/project/17/interface/api/2327
// 重新下载
export async function reExecuteTaskById(id: number, projectType: string) {
  return request('/teach-admin/admin/file/reExecuteTaskById', {
    params: {
      taskId: id,
      projectType: projectType,
    },
  });
}

// https://yapi.iqidao.com/project/17/interface/api/2322
// 更新下载时间
export async function updateFileUploadTime(taskId: number, projectType: string) {
  return request('/teach-admin/admin/file/updateFileUploadTime', {
    params: {
      taskId: taskId,
      projectType: projectType,
    },
  });
}

